home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / snippets_vol4 / snip_circles.dba < prev    next >
Encoding:
Text File  |  2000-10-13  |  1.0 KB  |  50 lines

  1. `    ------------------------------------------------------------------------
  2. `    Circles                                   DarkForge Snippet (11/10/2000)
  3. `    ------------------------------------------------------------------------
  4. `    Original code by: BigGun - dmartin@cnl.com.au - http://www.thebiggun.com
  5. `    Updated by Requiem and Hubdule. Generates really quite lovely patterns!!
  6.  
  7. hide mouse
  8. sync rate 0
  9. sync on
  10.  
  11. create bitmap 1,640,480
  12.  
  13. t#=timer()
  14.  
  15. for a = 1 to 200
  16.  
  17.     for i = 1 to 360
  18.  
  19.         x=320+cos(i)*a : y=240+sin(i)*a
  20.         randomize timer()
  21.         c=i*rnd(65535)
  22.  
  23. `        Uncomment the ink commands for different styles
  24. `        ink c,0
  25. `        ink rgb(c,int(c/12),int(c/20)),0
  26. `        ink rgb(int(c/12),int(c/6),255),0
  27.         ink rgb(int(c/6),255,int(c/6)),0
  28.  
  29.         dot x,y
  30.  
  31.     next i
  32.  
  33. `    Comment out these lines for extra speed (but a longer black screen)
  34.     copy bitmap 1,0
  35.     sync
  36.  
  37. next a
  38.  
  39. blur bitmap 1,2
  40.  
  41. ink rgb(255,255,255),0
  42. set cursor 0,0 : print "Image generated in ";(timer()-t#)/1000;" seconds"
  43.  
  44. copy bitmap 1,0
  45.  
  46. repeat
  47.     sync
  48. until spacekey()
  49.  
  50.